﻿#region Using namespaces

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

#endregion

namespace BOL.Apps.GeneNetworkBrowser.Controls
{
    public partial class RelationTypeFilter : GroupBox
    {
        public RelationTypes RelationTypes
        {
            get
            {
                RelationTypes relationTypes = RelationTypes.None;

                if (_cbDatabaseAll.IsChecked.Value)
                {
                    relationTypes |= RelationTypes.GX_PCC;
                    relationTypes |= RelationTypes.GX_MI;
                    relationTypes |= RelationTypes.Lit_NLP;
                    relationTypes |= RelationTypes.Lit_NCBI;
                    relationTypes |= RelationTypes.Lit_Comentioned;
                    relationTypes |= RelationTypes.PPI_HPRD;
                    relationTypes |= RelationTypes.PPI_IntAct;
                    relationTypes |= RelationTypes.PPI_REACTOME;
                    relationTypes |= RelationTypes.PPI_MINT;
                    relationTypes |= RelationTypes.PPI_MIPS;
                    relationTypes |= RelationTypes.PPI_DIP;
                    relationTypes |= RelationTypes.PPI_KEGG;
                    relationTypes |= RelationTypes.TF_JASPAR;
                    relationTypes |= RelationTypes.TF_PANTHER;
                    relationTypes |= RelationTypes.TF_KEGG;
                    relationTypes |= RelationTypes.TF_PAP;
                }
                else
                {

                    if (_cbDatabaseGXPCC.IsChecked.Value)
                        relationTypes |= RelationTypes.GX_PCC;
                    if (_cbDatabaseGXMI.IsChecked.Value)
                        relationTypes |= RelationTypes.GX_MI;
                    if (_cbDatabaseLitNLP.IsChecked.Value)
                        relationTypes |= RelationTypes.Lit_NLP;
                    if (_cbDatabaseLitNCBI.IsChecked.Value)
                        relationTypes |= RelationTypes.Lit_NCBI;
                    if (_cbDatabaseLitComentioned.IsChecked.Value)
                        relationTypes |= RelationTypes.Lit_Comentioned;
                    if (_cbDatabasePPIHPRD.IsChecked.Value)
                        relationTypes |= RelationTypes.PPI_HPRD;
                    if (_cbDatabasePPIIntAct.IsChecked.Value)
                        relationTypes |= RelationTypes.PPI_IntAct;
                    if (_cbDatabasePPIREACTOME.IsChecked.Value)
                        relationTypes |= RelationTypes.PPI_REACTOME;
                    if (_cbDatabasePPIMINT.IsChecked.Value)
                        relationTypes |= RelationTypes.PPI_MINT;
                    if (_cbDatabasePPIMIPS.IsChecked.Value)
                        relationTypes |= RelationTypes.PPI_MIPS;
                    if (_cbDatabasePPIDIP.IsChecked.Value)
                        relationTypes |= RelationTypes.PPI_DIP;
                    if (_cbDatabasePPIKEGG.IsChecked.Value)
                        relationTypes |= RelationTypes.PPI_KEGG;
                    if (_cbDatabaseTFJASPAR.IsChecked.Value)
                        relationTypes |= RelationTypes.TF_JASPAR;
                    if (_cbDatabaseTFPANTHER.IsChecked.Value)
                        relationTypes |= RelationTypes.TF_PANTHER;
                    if (_cbDatabaseTFKEGG.IsChecked.Value)
                        relationTypes |= RelationTypes.TF_KEGG;
                    if (_cbDatabaseTFPAP.IsChecked.Value)
                        relationTypes |= RelationTypes.TF_PAP;
                }

                return relationTypes;
            }
        }

        public RelationTypeFilter()
        {
            InitializeComponent();
        }
    }
}
